package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * Created by Administrator on 2016/5/19.
 */
public class SearchAction extends AHttpService<PbBean.PbResPageSearch> {
    private String content;
    private int offset;
    private PbBean.PbSignSearchType type;

    public static SearchAction newInstance(Context context, String content,int offset,PbBean.PbSignSearchType type) {
        return new SearchAction(context, content,offset,type);
    }

    private SearchAction(Context context, String content,int offset,PbBean.PbSignSearchType type) {
        super(context);
        this.content = content;
        this.offset=offset;
        this.type=type;

    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqPageSearch.Builder builder = PbBean.PbReqPageSearch.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setContent(content);
        builder.setOffset(offset);
        builder.setType(type);

        return apiService.search(builder.build());
    }
}
